

package com.hazelcast.transaction;

import com.hazelcast.collection.BaseQueue;
import com.hazelcast.collection.IQueue;

import javax.annotation.Nonnull;
import java.util.concurrent.TimeUnit;

/**
 * Transactional implementation of {@link BaseQueue}.
 *
 * @param <E> the type of elements held in this collection
 * @see BaseQueue
 * @see IQueue
 */
public interface TransactionalQueue<E> extends TransactionalObject, BaseQueue<E> {

    /**
     * {@inheritDoc}
     */
    @Override
    boolean offer(@Nonnull E e);

    /**
     * {@inheritDoc}
     */
    @Override
    boolean offer(@Nonnull E e, long timeout, @Nonnull TimeUnit unit) throws InterruptedException;

    /**
     * {@inheritDoc}
     */
    @Nonnull
    @Override
    E take() throws InterruptedException;

    /**
     * {@inheritDoc}
     */
    @Override
    E poll();

    /**
     * {@inheritDoc}
     */
    @Override
    E poll(long timeout, @Nonnull TimeUnit unit) throws InterruptedException;

    E peek();

    E peek(long timeout, TimeUnit unit) throws InterruptedException;

    /**
     * {@inheritDoc}
     */
    @Override
    int size();
}
